package com.kingsoft.miot.bridge.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.kingsoft.miot.bridge.pojo.ServiceAuth;

@Configuration
public class ServiceAuthConfig {

	@Value("${miot.service.url}")
	private String serviceUrl;

	@Value("${miot.service.groupid}")
	private String groupId;

	@Value("${miot.service.privatekey}")
	private String privateKey;

	@Value("${miot.service.publickey}")
	private String publicKey;

	@Bean
	public ServiceAuth serverAuth() {
		ServiceAuth server = new ServiceAuth();
		server.setServiceUrl(serviceUrl);
		server.setGroupId(groupId);
		server.setPrivateKey(privateKey);
		server.setPublicKey(publicKey);
		return server;
	}
}
